package sword.T55;

import util.TreeNode;

/**
 * @Author: 18362
 * @Create: 2022-04-10 0:46:23 星期日
 */
class Solution {
    public int maxDepth(TreeNode root) {
        if (root == null)
            return 0;
        int leftDepth = maxDepth(root.left);
        int rightDepth = maxDepth(root.right);
        return Math.max(leftDepth, rightDepth) + 1;
    }
}